
import java.awt.*;
import java.text.*;
import java.awt.event.*;
import java.sql.*;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.text.*;

import CustomEventClass.JDateEvent;
import CustomEventClass.JDateEventListener;

public class QueryScreen extends JPanel{
	private MoneyKeeperModel model;
	private MoneyKeeperView view;
	private JFormattedTextField startDate, endDate;
	private JButton startDateChooser, endDateChooser, submitQuery;
	private JLabel startDateLabel, endDateLabel;
	
	/*
	 * 
	 * 
	 */
	/*public static void main(String[] args){
		MoneyKeeperModel md = new MoneyKeeperModel();
		QueryScreen qs= new QueryScreen(md);
		JFrame frame = new JFrame("Test");
		frame.getContentPane().add(qs);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(1200,725);
		frame.setVisible(true);
	}*/
	QueryScreen(MoneyKeeperModel model){
		
		setSize(1200,725);
		this.setLayout(null);
		this.model = model;
		this.view = view;
		
		startDateLabel = new JLabel("START DATE:", JLabel.CENTER);
		endDateLabel = new JLabel("END DATE:", JLabel.CENTER);
		
		startDateLabel.setSize(100,30);
		startDateLabel.setLocation(0,0);
		endDateLabel.setSize(100,30);
		endDateLabel.setLocation(0,0);
		try {
			MaskFormatter formatter = new MaskFormatter("####-##-##");
			formatter.setPlaceholderCharacter('_'); 
			DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			DateFormatter df = new DateFormatter(sdf);
			startDate = new JFormattedTextField(df);
			
			startDate.setLocation(100,100);
			startDate.setSize(100,30);
			
			endDate = new JFormattedTextField(formatter);
			endDate.setLocation(200,200);
			endDate.setSize(100,30);
			
			startDateChooser = new JButton("Choose Date");
			endDateChooser = new JButton("Choose Date");
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		this.add(startDateLabel);
		this.add(startDate);
		this.add(startDateChooser);
		this.add(endDateLabel);
		this.add(endDate);
		this.add(endDateChooser);		
		
	}
}
